<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no" />
    <meta name="renderer" content="webkit">
    <meta name="keywords" content="{$navCur.keywords}"/>
    <meta name="description" content="{$navCur.description}"/>
    <title>{$navCur.seotitle}_{$site.site_name}</title>
    <link rel="stylesheet" type="text/css" href="__CDN__/assets/addons/wwh/css/swiper.min.css">
    <link rel="stylesheet" type="text/css" href="__CDN__/assets/addons/wwh/css/animate.min.css">
    <link rel="stylesheet" type="text/css" href="__CDN__/assets/addons/wwh/css/style.css">
    <link rel="stylesheet" type="text/css" href="__CDN__/assets/addons/wwh/css/media.css">
    <script type="text/javascript" src="__CDN__/assets/addons/wwh/js/jquery.min.js"></script>
    <script type="text/javascript" src="__CDN__/assets/addons/wwh/js/swiper.min.js"></script>
    <script type="text/javascript" src="__CDN__/assets/addons/wwh/js/swiper.animate1.0.3.min.js"></script>
    <script type="text/javascript" src="__CDN__/assets/addons/wwh/js/wow.js"></script>
    <script type="text/javascript" src="__CDN__/assets/addons/wwh/js/menu.js"></script>
    <script type="text/javascript" src="__CDN__/assets/addons/wwh/js/javascript.js"></script>
    <link rel="shortcut icon" href="__CDN__/assets/addons/wwh/images/favicon.ico">
</head>
<style>
    .upload .input input[type="file"]{
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
    }
</style>
<body>
<!--头部-->
{include file="header" /}
<!-- 栏目Banner -->
<div class="col-banner">
    <div class="text">
        <div class="title wow fadeInUp" data-wow-delay="0.3s">
            <h3>{$site.ban5_t1}</h3><i></i>
        </div>
    </div>
    <div class="img">
        <div class="pic" style="background-image: url('{$site.banner5|cdnurl}');">
            <img src="__CDN__/assets/addons/wwh/images/col_size.png" class="img-block" alt="">
        </div>
    </div>
    <div class="banner-path wow fadeInLeft" data-wow-delay="0.4s">
        <div class="container-outer">
            <div class="icon"><img src="__CDN__/assets/addons/wwh/images/home.svg" class="img-center"></div>
            <div class="link">
                <a href="{:addon_url('wwh/index/index')}">首页</a>
                <span>/</span>
                <a href="{:addon_url('wwh/index/column', [':diyname'=>$top.diyname])}">{if condition="($navCur.parent_id == '0')"} {$navCur.name} {else /} {$top.name} {/if}</a>
                <span>/</span>
                <a href="{:addon_url('wwh/index/column', [':diyname'=>$navCur.diyname])}" class="cur">{$navCur.name}</a>
            </div>
        </div>
    </div>
</div>
<!-- 内容 -->
<div class="join-detail">
    <div class="container-outer">
        <div class="join-box">
            <div class="top">
                <form method="get" action="" class="clearfix">
                    <div class="join-option">
                        <div class="dept wow fadeInUp" data-wow-delay="0.5s">
                            <select name="branch" id="branch">
                                <option value="" selected>所有部门</option>
                                {wwh:cvsearch table="wwh_position" field="dept" id="v"}
                                <option value="{$v.dept}">{$v.dept}</option>
                                {/wwh:cvsearch}
                            </select>
                        </div>
                        <div class="add wow fadeInUp" data-wow-delay="0.6s">
                            <select name="address" id="address">
                                <option value="" selected>工作地点</option>
                                {wwh:cvsearch table="wwh_position" field="addr" id="v"}
                                <option value="{$v.addr}">{$v.addr}</option>
                                {/wwh:cvsearch}
                            </select>
                        </div>
                    </div>
                    <div class="join-search wow fadeInUp" data-wow-delay="0.7s">
                        <div class="so-inp">
                            <input type="text" value="" name="keywords" id="keywords" placeholder="搜索职位" />
                        </div>
                        <input type="submit" value="" class="join-button" />
                    </div>
                </form>
            </div>
            <div class="bottom">
                {wwh:join id="v" page="6"}
                <div class="join-item wow fadeInUp" data-wow-delay="0.8s">
                    <div class="recruit-top">
                        <div class="recruit-top-box clearfix">
                            <div class="recruit-top-left">
                                <div class="psn">
                                    <p>{$v.name}</p>
                                </div>
                            </div>
                            <div class="recruit-top-right clearfix">
                                <div class="req">
                                    <p>{$v.dept}</p>
                                </div>
                                <div class="req">
                                    <p>{$v.addr}</p>
                                </div>
                                <div class="req">
                                    <p>{$v.num}</p>
                                </div>
                                <div class="req">
                                    <p>{$v.xueli}</p>
                                </div>
                                <div class="req">
                                    <p>{$v.time}</p>
                                </div>
                            </div>
                            <div class="drop-box">
                                <div class="drop-img">
                                    <img src="__CDN__/assets/addons/wwh/images/down_arrow1.svg" alt="" class="drop-ico1">
                                    <img src="__CDN__/assets/addons/wwh/images/down_arrow2.svg" alt="" class="drop-ico2">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="recruit-content">
                        <p>{$v.content}</p>
                        <a href="javascript:;" class="join-more" onclick="showForm(this.name)" name="{$v.name}">立即申请</a>
                    </div>
                </div>
                {/wwh:join}
            </div>
        </div>
    </div>
</div>
<div class="fenye wow fadeInUp" data-wow-delay="0.8s">{:$__LIST__->render()}</div>
<!--底部-->
{include file="footer" /}
<script>
    function showForm(e){
        var html = '<form id="resume" method="post" class="join-form">'+
            '        <div class="title">欢迎加入我们</div>'+
            '        <div class="message-text"><input type="text" placeholder="姓名" name="realname2" id="realname2" autocomplete="on"></div>'+
            '        <div class="message-text"><input type="text" placeholder="联系电话" name="tel2" id="tel2" autocomplete="on"></div>'+
            '        <div class="message-text"><input type="text" placeholder="应聘岗位" name="gangwei2" id="gangwei2" value="'+e+'" readonly="readonly" style="background-color: #eeeeee;cursor: not-allowed;"></div>'+
            '        <div class="upload">'+
            '            <div class="text"><strong>上传简历*</strong><span>支持word、excel、pdf、ppt</span></div>'+
            '            <div class="input">'+
            '                <span id="file_name"></span>'+
            '                <div class="right">'+
            '                    <span>上传简历</span>'+
            '                    <input type="file" name="url" id="url" onchange="changeFile(this);">'+
            '                </div>'+
            '            </div>'+
            '        </div>'+
            '        <div class="validate">'+
            '            <div class="message-text"><input type="text" placeholder="验证码" name="verify2" id="verify2" autocomplete="off"></div>'+
            '            <img id="verifyImgs2" class="verify-img" src="{:addon_url(\'wwh/index/verify\')}" onclick="this.src=\'{:addon_url(\'wwh/index/verify\')}?seed=\'+Math.random()" />'+
            '        </div>'+
            '        <div class="resume-subbox"><div class="resume-submit">提交</div></div>'+
            '</form>';
        layer.open({
            type: 1,
            title: false,
            closeBtn: 1,
            shadeClose: false,
            anim:1,
            area: ['auto','auto'],
            content: html,
        });

        //提交简历
        $(".resume-submit").click(function(){
            var formdata = new FormData(document.getElementById("resume"));
            var realname2=$.trim($("#realname2").val());
            var tel2=$.trim($("#tel2").val());
            var gangwei2=$.trim($("#gangwei2").val());
            var url=$.trim($("#url").val());
            var verify2=$.trim($("#verify2").val());
            if(realname2==''){layer.alert('请填写姓名',{skin: 'layui-layer-lan' ,closeBtn: 0,title:"温馨提示：",icon:2,anim:2});return false;}
            if(tel2==''){layer.alert('请填写电话',{skin: 'layui-layer-lan' ,closeBtn: 0,title:"温馨提示：",icon:2,anim:2});return false;}
            var reg=/(^(\d{3,4}-)?\d{7,8})$|(1[3|4|5|7|8|9]\d{9})$/;
            if(!reg.test(tel2)){layer.alert('请填写有效的电话',{skin: 'layui-layer-lan' ,closeBtn: 0,title:"温馨提示：",icon:2,anim:2});return false;}
            if(gangwei2==''){layer.alert('请选择应聘岗位',{skin: 'layui-layer-lan' ,closeBtn: 0,title:"温馨提示：",icon:2,anim:2});return false;}
            if(url==''){layer.alert('请上传简历',{skin: 'layui-layer-lan' ,closeBtn: 0,title:"温馨提示：",icon:2,anim:2});return false;}
            if(verify2==''){layer.alert('请填写验证码',{skin: 'layui-layer-lan' ,closeBtn: 0,title:"温馨提示：",icon:2,anim:2});return false;}
            //重载验证码
            function fleshVerify(){
                $('#verifyImgs2').attr('src','{:addon_url('wwh/index/verify')}?seed='+Math.random());
            }
            $.ajax({
                url: "{:addon_url('wwh/index/injoin')}",
                type: "POST",
                data:formdata,
                cache:false,
                async:false,
                contentType: false,
                processData: false,
                dataType:"json",
                success: function(mes){
                    if(mes==1){
                        alert("提交成功");
                        window.location.reload();
                    }else if(mes==2){
                        layer.alert('请检查后台邮件配置|插件邮箱配置',{skin: 'layui-layer-lan' ,closeBtn: 0,title:"温馨提示：",icon:2,anim:2});
                        fleshVerify();
                    }else if(mes==3) {
                        layer.alert('上传文件后缀不允许', {skin: 'layui-layer-lan',closeBtn: 0,title: "温馨提示：",icon: 2,anim: 2});
                        fleshVerify();
                    }else {
                        layer.alert('验证码错误，请重试',{skin: 'layui-layer-lan' ,closeBtn: 0,title:"温馨提示：",icon:2,anim:2});
                        fleshVerify();
                    }
                }
            })
        })
    };

    function changeFile(obj) {
        console.log($(obj)[0].value.split('\\'));
        $("#file_name").text($(obj)[0].value.split('\\')[2]);
    };
</script>
<script type="text/javascript">
    $(function () {
        $(".join-item .recruit-top").click(function(){
            $(this).siblings(".recruit-content").slideToggle();
            $(this).parents().siblings().find(".recruit-content").slideUp();
            $(this).parent().toggleClass("on");
            $(this).parent().siblings().removeClass("on");
        })
    });
</script>
</body>
</html>
